package com.sjh.sjhliving.commodity.controller;


import com.sjh.common.utils.PageUtils;
import com.sjh.sjhliving.commodity.entity.SkuInfoEntity;
import com.sjh.sjhliving.commodity.service.SkuInfoService;
import com.sjh.sjhliving.commodity.vo.SearchResult;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Controller
public class SearchController {

    @Resource
    private SkuInfoService skuInfoService;

    @RequestMapping("/list.html")
    public String searchList(@RequestParam Map<String, Object> params,
                             Model model, HttpServletRequest request) {

        /**
         * 带条件分页查询
         */
        SearchResult searchResult = skuInfoService.querySearchPageByCondition(params);
        model.addAttribute("result", searchResult);

        return "list";
    }
}
